<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .out {
            width: 500px;
            margin:20px auto;
            background-color: #cdcdcd;
            border-radius: 14px;
            height: 20px;
            overflow: hidden;
        }
        .in{
            background-color: deeppink;
            height: 100%;
            border-radius: 14px;
            width: 0px;
        }
    </style>
    <script src="js/jquery.min.js"></script>

</head>
<body>
    <div class="out">
        <div class="in"></div>
    </div>

    <button class="add">+</button>
    <br>
    <button class="sub">-</button>
</body>
<script>
    $(function(){
        var width = 0;
        $('.add').click(function(){
            width = width+100;
            $('.in').width(width);
            if(width>=500){
                $(this).prop('disabled',true)
                return;
            }
            
        })
        var flag = true;
        $('.sub').click(function(){
            width = width - 100;
            $('.in').width(width);
            if(width<500 && flag){
                console.log('11111')
                $('.add').prop('disabled',false)
                flag = false;
            }
            if(width<=0){
                $(this).prop('disabled',true)
            }
        })
    })
</script>
</html>